{% extends "base.html" %}
{% load i18n static wger_extras %}

{% block title %}{% translate "Categories" %}{% endblock %}


{% block content %}
    <ul class="list-group">
        {% for category in exercisecategory_list %}
            <li class="list-group-item list-group-item-action">
                <div class="btn-group float-end">
                    <button type="button" class="btn btn-dark dropdown-toggle btn-sm"
                            data-bs-toggle="dropdown">
                        <span class="{% fa_class 'cog' %}"></span>
                    </button>
                    <div class="dropdown-menu dropdown-menu-right" role="menu">
                        {% translate 'Edit' as text %}
                        {% url 'exercise:category:edit' category.id as url %}
                        {% modal_link url=url text=text css_class='dropdown-item' %}

                        {% translate 'Delete' as text %}
                        {% url 'exercise:category:delete' category.id as url %}
                        {% modal_link url=url text=text css_class='dropdown-item' %}
                    </div>
                </div>
                {{ category }}
            </li>
            {% empty %}
            <li class="list-group-item">
                {% translate "Nothing found" %}
            </li>
        {% endfor %}
    </ul>
{% endblock %}



{% block options %}
{% if perms.exercises.add_exercisecategory %}
    {% translate 'Add' as text %}
    {% modal_link url='exercise:category:add' text=text %}
{% endif %}
{% endblock %}
